home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / ntkb.zip / NTKB.EXE / Q100 / 8 / 43.TXT
Text File  |  1993-09-28  |  5KB  |  138 lines

  1. DOCUMENT:Q100843  24-SEP-1993  [W_NT]
  2. TITLE   :Environment Variables in Windows NT
  3. PRODUCT :Windows NT
  4. PROD/VER:3.10
  5. OPER/SYS:WINDOWS
  6. KEYWORDS:
  7.  
  8. --------------------------------------------------------------------
  9. The information in this article applies to:
  10.  
  11.  - Microsoft Windows NT operating system version 3.1
  12.  - Microsoft Windows NT Advanced Server version 3.1
  13. --------------------------------------------------------------------
  14.  
  15. There are three levels of environment variables in Windows NT; the
  16. system environment variables, the user environment variables, and the
  17. environment variables that are set in the AUTOEXEC.BAT file. There are
  18. also some predefined environment variables that are set when the user
  19. logs on. This article discusses the following topics:
  20.  
  21.  - System environment variables
  22.  - User environment variables
  23.  - AUTOEXEC.BAT environment variables
  24.  - How environment variables are set
  25.  - How the path is built
  26.  - Changing user environment variables using control panel
  27.  
  28. System Environment Variables
  29. ----------------------------
  30.  
  31. System environment variables can be viewed from Control Panel by
  32. choosing the System icon. These variables are always set no matter who
  33. logs on and they cannot be changed by any user.
  34.  
  35. There are a few additional predefined environment variables that are
  36. set when the user logs on that do not appear in the System dialog box:
  37.  
  38.    USERNAME
  39.    USERDOMAIN
  40.    NTVERSION
  41.    WINDIR
  42.    OS
  43.    PROCESSOR_ARCHITECTURE
  44.       values: x86, MIPS or ALPHA
  45.    PROCESSOR_LEVEL
  46.       values for x86: 3, 4, 5
  47.       values for MIPS: 3000, 4000
  48.       values for ALPHA: 21064
  49.    HOMEPATH
  50.    HOMEDRIVE
  51.    HOMESHARE
  52.       These three environment variables are set based on the value of
  53.       the home directory. The user's home directory is specified in
  54.       User Manager (Choose Profile and Properties). If the home
  55.       directory uses universal naming conventions (UNC), then they
  56.       will have the following values:
  57.  
  58.           HOMESHARE=\\<server name>\<share name>
  59.           HOMEPATH=\<path>
  60.           HOMEDRIVE=<drive letter>:
  61.  
  62.       If the home directory is a local path such as c:\nt then they
  63.       will look like this:
  64.  
  65.           HOMEDRIVE=c:
  66.           HOMESHARE=
  67.           HOMEPATH=\nt
  68.  
  69. All above environment variables are always present and therefore may
  70. be used in logon scripts.
  71.  
  72. User Environment Variables
  73. --------------------------
  74.  
  75. User environment variables can be viewed from Control Panel as well.
  76. The user may add, delete or modify the environment variables in the
  77. User Environment Variables for User field. These variables take
  78. precedence over system environment variables. The user path is
  79. appended to the system path.
  80.  
  81. AUTOEXEC.BAT Environment Variables
  82. ----------------------------------
  83.  
  84. All environment variables and the paths set in the AUTOEXEC.BAT file
  85. are used to create the Windows NT environment. Any paths in the
  86. AUTOEXEC.BAT file are append to the system path.
  87.  
  88. How Environment Variables Are Set
  89. ---------------------------------
  90.  
  91. Environment variables are set in the following order:
  92.  
  93.  - System variables
  94.  - AUTOEXEC.BAT variables
  95.  - User variables
  96.  
  97. How the Path Is Built
  98. ---------------------
  99.  
  100. The Path is constructed from the system path, which can be viewed in
  101. the System Environment Variables field in the System dialog box. The
  102. User path is appended to the system path. Then the path from the
  103. AUTOEXEC.BAT file is appended.
  104.  
  105. Note: The environment variables LibPath and Os2LibPath are built the
  106. same way (system path + user path + AUTOEXEC.BAT path).
  107.  
  108. Changing User Environment Variables Using Control Panel
  109. -------------------------------------------------------
  110.  
  111. User environment variables can be added, changed or deleted from
  112. Control Panel. There is no need to reboot after making any of these
  113. changes. Changes take effect immediately after exiting the System
  114. dialog box.
  115.  
  116. The next application you start will use the new settings. All other
  117. applications running before the changes were made will not recognize
  118. the changes.
  119.  
  120. Additional reference words: 3.10 winnt
  121. KBCategory:
  122. KBSubCategory: WINNT 
  123.  
  124. =============================================================================
  125.  
  126. THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
  127. PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  MICROSOFT DISCLAIMS
  128. ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
  129. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO
  130. EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
  131. ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
  132. CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
  133. MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
  134. POSSIBILITY OF SUCH DAMAGES.  SOME STATES DO NOT ALLOW THE EXCLUSION
  135. OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
  136. SO THE FOREGOING LIMITATION MAY NOT APPLY.
  137.  
  138. Copyright Microsoft Corporation 1993.